package com.dubbo.controller;

import com.dubbo.entity.User;
import com.dubbo.service.UserService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class UserController {

    @DubboReference
    private UserService userService;


    @GetMapping("{id}")
    public User getById(@PathVariable Long id){
        return userService.getById(id);
    }
}
